package com.taobao.pamirs.schedule.job;

import com.taobao.pamirs.schedule.IScheduleTaskDealSingle;
import com.taobao.pamirs.schedule.TaskItemDefine;

import java.util.List;

/**
 * Created by yangwenchang on 2017/4/16.
 */
public abstract class AbstractTaskDealSingle<T> implements IScheduleTaskDealSingle<T> {
    public AbstractTaskDealSingle() {
    }

    public final boolean execute(T task, String ownSign) throws Exception {
        return this.handleTask(task, ownSign);
    }

    public final List<T> selectTasks(String taskParameter, String ownSign, int taskItemNum, List<TaskItemDefine> taskItemList, int eachFetchDataNum) throws Exception {
        return this.queryTasks(taskParameter, ownSign, taskItemNum, taskItemList, eachFetchDataNum);
    }

    protected abstract boolean handleTask(T var1, String var2) throws Exception;

    protected abstract List<T> queryTasks(String var1, String var2, int var3, List<TaskItemDefine> var4, int var5);
}
